.com
Hosted by:
Unit testing expertise at your fingertips!
Home | Discuss | Lists

Hexagonal Architecture

The book has now been published and the content of this chapter has likely changed substanstially.

Also known as: Ports and Adapters


Create your application to work without either a UI or a database so you can run automated regression-tests against the application, work when the database becomes unavailable, and link applications together without any user involvement.

Alistair Cockburn has an interesting take on Layered Architectures[DDD,PEAA,WWW]; he views the domain model as the core of a hexagon that is surrounded by "Ports and Adapters" that connect it to the outside world (including a database).

Allow an application to equally be driven by users, programs, automated test or batch scripts, and to be developed and tested in isolation from its eventual run-time devices and databases. As events arrive from the outside world at a port, a technology-specific adapter converts it into a usable procedure call or message and passes it to the application. The application is blissfully ignorant of the nature of the input device. When the application has something to send out, it sends it out through a port to an adapter, which creates the appropriate signals needed by the receiving technology (human or automated). The application has a semantically sound interaction with the adapters on all sides of it, without actually knowing the nature of the things on the other side of the adapters.

Further Reading

Alistair's full write-up is at http://alistair.cockburn.us/crystal/articles/hpaaa/hexagonalportsandadaptersarchitecture.htm



Page generated at Wed Feb 09 16:39:05 +1100 2011

Copyright © 2003-2008 Gerard Meszaros all rights reserved

All Categories
Introductory Narratives
Web Site Instructions
Code Refactorings
Database Patterns
DfT Patterns
External Patterns
Fixture Setup Patterns
Fixture Teardown Patterns
Front Matter
Glossary
Misc
References
Result Verification Patterns
Sidebars
Terminology
Test Double Patterns
Test Organization
Test Refactorings
Test Smells
Test Strategy
Tools
Value Patterns
XUnit Basics
xUnit Members
All "External Patterns"
Abstract Factory
Adapter
Command
Comparator
Complete Constructor Method
Composite
Data Access Object
Data Transfer Object
Decorator
Domain Model
Facade
Factory Method
Foreign Method
Guard Clause
Hexagonal Architecture
--Ports and Adapters
Integration Build
Intent Revealing Name
Interpreter
Layered Architecture
Lazy Initialization
Marker Interface
Noun Phrase Name
Null Object
Observer
Pluggable Behavior
Private Workspace
Prototype
Registry
Remote Facade
Remote Proxy
Repository
Self-Call
Service Facade
Service Layer
Session Facade
Singleton
Skippable Sections
Smoke Test
State
Strategy
Template Method
Thread-Specific Storage
Transaction Script
Ubiquitous Language
Virtual Clock